/**
 * 测试类 - 验证各版本功能
 */
public class CalculationSystemTest {
    
    public static void main(String[] args) {
        System.out.println("开始测试加减法口算练习系统...");
        
        // 测试V0.1
        testV01();
        
        // 测试V0.2  
        testV02();
        
        // 测试V0.3
        testV03();
        
        System.out.println("所有测试完成！");
    }
    
    public static void testV01() {
        System.out.println("\n=== 测试 v0.1 ===");
        String[] equations = CalculationSystemV01.generateEquations(10);
        System.out.println("生成10道算式测试:");
        CalculationSystemV01.printEquations(equations, 5);
    }
    
    public static void testV02() {
        System.out.println("\n=== 测试 v0.2 ===");
        String[] equations = CalculationSystemV02.generateEquations(10);
        System.out.println("生成10道含答案算式测试:");
        CalculationSystemV02.printEquations(equations, 3);
        
        // 验证加法算式和不超过100
        for (String eq : equations) {
            if (eq.contains("+")) {
                String[] parts = eq.split("=");
                int result = Integer.parseInt(parts[1].trim());
                if (result > 100) {
                    System.out.println("错误: 加法算式和超过100: " + eq);
                }
            }
        }
    }
    
    public static void testV03() {
        System.out.println("\n=== 测试 v0.3 ===");
        String[] equations = CalculationSystemV03.generateUniqueEquations(10, 0.5);
        System.out.println("生成10道不重复算式测试:");
        CalculationSystemV03.printEquations(equations, 3);
        CalculationSystemV03.printStatistics(equations);
    }
}